package com.topsun.posclient.sales.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.topsun.posclient.common.service.impl.BaseServiceImpl;
import com.topsun.posclient.sales.dao.PartSaleLocalDao;
import com.topsun.posclient.sales.entity.PartSales;
import com.topsun.posclient.sales.entity.PartSalesDTO;
import com.topsun.posclient.sales.service.IPartSaleService;

/**
 * 零售服务实现
 * 
 * @author Dong
 *
 */
@Service
public class PartSaleServiceImpl extends BaseServiceImpl implements IPartSaleService {
	
	@Autowired
	private PartSaleLocalDao partSaleLocalDao;

	/* (non-Javadoc)
	 * @see com.topsun.posclient.sales.service.IPartSaleService#saveSaleData(com.topsun.posclient.sales.entity.PartSales)
	 */
	public void saveSaleData(List<PartSales> partSalesList) throws Exception {
		PartSalesDTO salesDTO = new PartSalesDTO();
		salesDTO.setPartSalesList(partSalesList);
		
		try {
			partSaleLocalDao.saveSalesData(salesDTO);
		} catch (Exception e) {
			e.printStackTrace();
			throw new Exception("保存本地数据失败！");
		}
	}

}
